package storage;
/*import MessageHandler;
import MessagePasser;

import java.io.*;
import java.net.*;
import java.util.*;

public class Process_old extends Thread implements MessageHandler
{
	MessagePasser postman;
	ArrayList files;
	boolean running = true;
	Scanner scan;
	int partnerID;
	
	public Process_old(int PORT)
	{
		try
		{
			postman = new MessagePasser(this, PORT);
		}
		catch(IOException e)
		{
			System.out.println("Could not build MessagePasser, quitting");
			System.exit(0);
		}
		files = new ArrayList<File>();
		scan = new Scanner(System.in);
		partnerID = 0;
		this.start();
	}
	public void run()
	{
		
		// Set up the connection
		
		System.out.print("What port would you like to connect to (0 for initial node)? ");
		int partner = scan.nextInt();
		scan.nextLine();
		if(partner > 0)

		{
			try
			{
//				partnerID = postman.addConnection("localhost:"+partner);
				System.out.println("Successfully connected to partner at position: " + partnerID);
			}
			catch (Exception e)
			{
				System.out.println("Could not connect, quitting");
				System.exit(0);
			}
		}
		else

		{
			System.out.println("Starting a new group");

		}


		String input = "";
		
		// Execute the main loop of the program
		
		do
		{
			System.out.print("->");
			try
			{
				input = scan.nextLine() + "\n";
//				postman.send(partnerID, input, this);
			}
			catch(IllegalStateException e)
			{
				System.out.println("Scanner closed");
			}
			catch(Exception e)
			{
				System.out.println("Error sending message: " + e);
			}
			if (input.equals("close\n"))
			{
				System.out.println("Closing connection");
				shutdown();
			}
		}
		while(running);
		System.out.println("Closed client");
	}
	public void receive(String msg)
	{
		if (msg.equals("close"))
		{
			System.out.println("Partner closed connection.");
			shutdown();
		}
		System.out.println("Received:" + msg);
		System.out.print("->");
	}
	public void shutdown()
	{
		try
		{
			postman.close();
		}
		catch (Exception e)
		{
			System.out.println("Problem closing the MessagePasser");
		}
		
//		System.out.println("Finished closing the postman.");
//		scan.close();
//		System.out.println("Finished closing the scanner.");
//		running = false;
		
		System.exit(0);
	}
	public static void main(String [] args)
	{
		new Process_old(Integer.parseInt(args[0]));
	}
}
*/